import React from "react";
import { Route, Routes, Navigate, NavLink } from "react-router-dom";

import "../assets/css/foot.css";
import Home from '../views/home'
import Cart from "../views/cart";
import Mine from "../views/mine"
import Cate from "../views/cate"
class Index extends React.Component {
  render() {
    return (
      <div>
        <Routes>
          <Route path='home' element={<Home />}></Route>
          <Route path='cart' element={<Cart />}></Route>
          <Route path='mine' element={<Mine />}></Route>
          <Route path='cate' element={<Cate />}></Route>
          {/* 二级路由重定向 */}
          <Route
            path=""
            element={<Navigate to="/index/home"></Navigate>}
          ></Route>
        </Routes>
        <footer>
          <div className="foot_top">
            <NavLink to="/index/home">
              <p className="iconfont icon-shouyeshangdian"></p>
              商城
            </NavLink>
            <NavLink to="/index/cate">
              <p className="iconfont icon-shouyeshangdian"></p>
              分类
            </NavLink>
            <NavLink to="/index/cart">
              <p className="iconfont icon-shouyeshangdian"></p>
              购物车
            </NavLink>
            <NavLink to="/index/mine">
              <p className="iconfont icon-shouyeshangdian"></p>我
            </NavLink>
          </div>
        </footer>
      </div>
    );
  }
}
export default Index;
